***MALAWI Behavioral Biases Study
***DO FILE 4: TABLE 4 (Heterogeity analyses for Partner Invitation)
***KEXIN ZHANG
***November 21, 2025

version 13
clear all

use "$data\MBBS_Analysis_data.dta"

global balance_covariates "age_binary cont_use1 eff_attribute"
		
*==============================================================================
*================== Keep the final analytical sample of 638 women ==============
*==============================================================================
keep if w1_mergeRand == 3
keep if COUN__FV_1 == 1

* consent
	keep if PHO_REC_4 == 1 | HOME_REV_20 == 1 | mergeCLI == 3 //675

* Drop pregnant women at counseling
	drop if COUN_118 == 1

* Drop pregnant women at FUP
	drop if PHO_103 == 1 | HOME_103 == 1 //638

	eststo clear
foreach var of varlist women_own_house_a women_earn_more women_decide_her_m women_child_edu husb_supports_fp husb_want_more{
preserve
eststo `var'_Y1: reg diff_method_8 HUSB_T `var' c.HUSB_T#c.`var' $balance_covariates if COUN__FV_1 == 1, vce(robust) 
summarize diff_method_8 if HUSB_T == 0 & COUN__FV_1 == 1 
estadd scalar ymean = r(mean)
test _b[HUSB_T] + _b[c.HUSB_T#c.`var'] = 0
estadd scalar pvalue1 = r(p)

eststo `var'_Y2: reg diff_method_3 HUSB_T `var' c.HUSB_T#c.`var' $balance_covariates, vce(robust) 
summarize diff_method_3 if HUSB_T == 0 
estadd scalar ymean = r(mean)
test _b[HUSB_T] + _b[c.HUSB_T#c.`var'] = 0
estadd scalar pvalue1 = r(p)

eststo `var'_Y3: reg intertemperal_concordance HUSB_T `var' c.HUSB_T#c.`var' $balance_covariates, vce(robust) 
summarize intertemperal_concordance if HUSB_T == 0
estadd scalar ymean = r(mean)
test _b[HUSB_T] + _b[c.HUSB_T#c.`var'] = 0
estadd scalar pvalue1 = r(p)

eststo `var'_Y4: reg contemp_concordance HUSB_T `var' c.HUSB_T#c.`var' $balance_covariates if COUN__FV_1 == 1, vce(robust) 
summarize contemp_concordance if HUSB_T == 0 & COUN__FV_1 == 1
estadd scalar ymean = r(mean)
test _b[HUSB_T] + _b[c.HUSB_T#c.`var'] = 0
estadd scalar pvalue1 = r(p)
restore
}

label var HUSB_T "Partner invitation (PI)"
esttab women_earn_more_Y1 women_earn_more_Y2 women_earn_more_Y3 women_earn_more_Y4 using "$output\Table_4.tex", replace fragment label nolines ///
cells(b(star fmt(%9.3f)) se(par( [ ] ) fmt(%9.3f))) starlevels(* 0.2 ** 0.1 *** 0.02) compress style(tab) keep(HUSB_T c.HUSB_T#c.women_earn_more) ///
prehead("\begin{table}\begin{center}\caption{Heterogeneity in the Treatment Effect of Partner Invitation}\label{tab: partnerbygroup}\tabcolsep=0.3cm\scalebox{0.76}{\begin{tabular}{lcccc}\toprule") ///
stats(N pvalue1, fmt(%9.0f %9.3f) labels("N" "\makecell[l]{PI + PI $\times$ Women earn \\ more = 0}"))  ///
coeflabel(c.HUSB_T#c.women_earn_more "PI $\times$  Women earn more") collabels(none) nonumbers posthead("\midrule" ) ///
mtitles("\makecell{Change in \\ Stated Preferred Method}" "\makecell{Change in \\ Method Use}" "\makecell{Intertemporal \\ Concordance}" "\makecell{Contemporaneous \\ Concordance}") postfoot("\cdashline{1-5}")

esttab women_decide_her_m_Y1 women_decide_her_m_Y2 women_decide_her_m_Y3 women_decide_her_m_Y4 using "$output\Table_4.tex", append fragment label nolines ///
cells(b(star fmt(%9.3f)) se(par( [ ] ) fmt(%9.3f))) starlevels(* 0.2 ** 0.1 *** 0.02) compress style(tab) keep(HUSB_T c.HUSB_T#c.women_decide_her_m) ///
stats(N pvalue1, fmt(%9.0f %9.3f) labels("N" "\makecell[l]{PI + PI $\times$ Women decide her \\ earnings = 0}"))  ///
coeflabel(women_decide_her_m "\makecell[l]{Woman decide \\ her earnings}" c.HUSB_T#c.women_decide_her_m "PI $\times$ Women decide her earnings") nomtitles collabels(none) nonumbers postfoot("\cdashline{1-5}")

esttab women_own_house_a_Y1 women_own_house_a_Y2 women_own_house_a_Y3 women_own_house_a_Y4 using "$output\Table_4.tex", append fragment label nolines ///
cells(b(star fmt(%9.3f)) se(par( [ ] ) fmt(%9.3f))) starlevels(* 0.2 ** 0.1 *** 0.02) compress style(tab) keep(HUSB_T c.HUSB_T#c.women_own_house_a) ///
stats(N pvalue1, fmt(%9.0f %9.3f) labels("N" "\makecell[l]{PI + PI $\times$ Women own a house \\ alone = 0}"))  ///
coeflabel(women_own_house_a "\makecell[l]{own a house alone}" c.HUSB_T#c.women_own_house_a "PI $\times$ Women own a house alone") nomtitles collabels(none) nonumbers postfoot("\cdashline{1-5}")

esttab women_child_edu_Y1 women_child_edu_Y2 women_child_edu_Y3 women_child_edu_Y4 using "$output\Table_4.tex", append fragment label nolines ///
cells(b(star fmt(%9.3f)) se(par( [ ] ) fmt(%9.3f))) starlevels(* 0.2 ** 0.1 *** 0.02) compress style(tab) keep(HUSB_T c.HUSB_T#c.women_child_edu) ///
stats(N pvalue1, fmt(%9.0f %9.3f) labels("N" "\makecell[l]{PI + PI $\times$ Women decide child's \\ education = 0}"))  ///
coeflabel(c.HUSB_T#c.women_child_edu "PI $\times$ Women decide child's education") nomtitles collabels(none) nonumbers postfoot("\cdashline{1-5}")

esttab husb_want_more_Y1 husb_want_more_Y2 husb_want_more_Y3 husb_want_more_Y4 using "$output\Table_4.tex", append fragment label nolines ///
cells(b(star fmt(%9.3f)) se(par( [ ] ) fmt(%9.3f))) starlevels(* 0.2 ** 0.1 *** 0.02) compress style(tab) keep(HUSB_T c.HUSB_T#c.husb_want_more) ///
stats(N pvalue1, fmt(%9.0f %9.3f) labels("N" "\makecell[l]{PI + PI $\times$ Husband wants more \\ children = 0}"))  ///
coeflabel(husb_want_more "Husband wants more children" c.HUSB_T#c.husb_want_more "PI $\times$ Husband wants more \\ children") nomtitles collabels(none) nonumbers postfoot("\cdashline{1-5}")

esttab husb_supports_fp_Y1 husb_supports_fp_Y2 husb_supports_fp_Y3 husb_supports_fp_Y4 using "$output\Table_4.tex", append fragment label nolines ///
cells(b(star fmt(%9.3f)) se(par( [ ] ) fmt(%9.3f))) starlevels(* 0.2 ** 0.1 *** 0.02) compress style(tab) keep(HUSB_T c.HUSB_T#c.husb_supports_fp) ///
stats(N pvalue1, fmt(%9.0f %9.3f) labels("N" "\makecell[l]{PI + PI $\times$ Husband supports FP = 0}"))  ///
coeflabel(c.HUSB_T#c.husb_supports_fp "\makecell[l]{PI $\times$ Husband supports FP}") nomtitles collabels(none) nonumbers postfoot("\bottomrule \end{tabular}} \end{center}\footnotesize{Notes: Balancing control variables include a woman's age, her contraceptive use at baseline, and whether her most valued attribute was contraceptive effectiveness. Variable definitions are presented in Table \ref{tab: variable_descriptions}. Heteroskedastic-robust standard errors are presented in brackets. *** 1\%, ** 5\%, * 10\%.} \end{table}") nogaps
